var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var r, c = arguments.length, i = c < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n); else for (var s = t.length - 1; 0 <= s; s--) (r = t[s]) && (i = (c < 3 ? r(i) : 3 < c ? r(e, o, i) : r(e, o)) || i);
    return 3 < c && i && Object.defineProperty(e, o, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("LoadManager"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.sprite = null, t.checkMark = null, t.isChecked = !1, t.item = null, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        this.node.on(cc.Node.EventType.TOUCH_END, this.onToggle, this);
    }, t.prototype.onDestroy = function() {
        this.node.off(cc.Node.EventType.TOUCH_END, this.onToggle, this);
    }, t.prototype.onToggle = function() {
        this.switchCheck(), this.node.dispatchEvent(new cc.Event("toggle", !0));
    }, t.prototype.start = function() {}, t.prototype.init = function(t) {
        this.item = t, s.default.getInstance().loadSpriteFrame({
            url: "image/arm/" + (r.G.gunModelList.length - 1),
            sprite: this.sprite
        });
    }, t.prototype.switchCheck = function() {
        this.isChecked ? (this.isChecked = !1, this.checkMark.node.active = !1) : (this.isChecked = !0, 
        this.checkMark.node.active = !0);
    }, a([ d(cc.Sprite) ], t.prototype, "sprite", void 0), a([ d(cc.Sprite) ], t.prototype, "checkMark", void 0), 
    a([ l ], t);
}(cc.Component);

n.default = u;